 <?php
include("../../config.php");
include(FILE_ROOT."/common/db.php");
include(FILE_ROOT."/common/user_client.php");
include(FILE_ROOT."/common/common_function.php");
if(!checkIsLogin()){
    echo '{"status":-2,"message":"没有权限！","data":""}';return;
}

$users = new UserClient();
//echo json_encode(json_decode($users -> getMenu($_COOKIE["CCUSER"]),true)['data']);

$menu = getMenu($_COOKIE["CCUSER"]);
//print_r($menu);die;


 /*$menu = array(
         	'VM' => array(
         		'text'	=>	'虚拟机管理', 
        		'url'	=>	'VM/overview',
         		'icon_class' => 'fa-server',
         		'children' => array(
        			'overview' =>  array(
        				'text' => '虚拟机列表',
        				'url'  => 'VM/overview'
        				),
        			'create' =>  array(
        				'text' => '添加虚拟机',
        				'url'  => 'VM/create'
        				),
                            'image' =>  array(
                                'text' => '映像列表',
                                'url'  => 'VM/image'
                                ),
        			),
        		),
        	'VM' => array(
        		'text'    =>  '虚拟机管理',  
        		'url' =>  'VM/overview',
       		'icon_class' => 'fa-server',
        		'children' => array(
        			'create' =>  array(
                        'text' => '添加虚拟机',
                        'url'  => 'VM/create'
                        ),
       			'overview' =>  array(
                        'text' => '虚拟机列表',
                        'url'  => 'VM/overview'
                        ),
                 'image' =>  array(
                                'text' => '映像列表',
                                'url'  => 'VM/image'
                                )
        			),
       		)
         );*/
$menu = json_encode( $menu );
echo $menu;
       